<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    <title>温度转换</title>
</head>

<body>
<div class="out">
    <form name="fo">
        <p>摄氏度&nbsp;&nbsp;>>&nbsp;&nbsp;华氏度</p>
        <input type="text" style="width: 40px;" name="c1" value={{c1}}>℃ >> <input type="text" style="width: 40px;" readonly placeholder="华氏度" name="f1" value={{f1}}>°F<br>
        <input type="button" value="转换" onclick="tem1()">
        <br><br><br>
        <p>华氏度&nbsp;&nbsp;>>&nbsp;&nbsp;摄氏度</p>
        <input type="text" style="width: 40px;" name="f2" value={{f2}}>°F >> <input type="text" style="width: 40px;" readonly placeholder="摄氏度" name="c2" value={{c2}}>℃<br>
        <input type="button" value="转换" onclick="tem2()">
    </form>
    {% if flog=="False" %}
        <script >
            alert("不要转换 空值 或者 非数字")
        </script>
    {% endif %}
</div>
</body>

<script>
    function tem1() {
        document.fo.action = "http://localhost:5000/project01/temperature1";
        document.fo.method = "post";
        document.fo.submit();
    }

    function tem2() {
        document.fo.action = "http://localhost:5000/project01/temperature2";
        document.fo.method = "post";
        document.fo.submit();
    }
</script>
</html>